Ext.namespace("Issue.Main");

Issue.Main.tabIndex = {
	"toreport" : 0,
	"search" : 4
};
Issue.Main.tabs = [];

Issue.initUI = function() {

	var flag="";
		 //action
	 var conn = new Ext.data.Connection({
	    url:'../security/checkMenu.form?timesnap=' + Date.parse(new Date()),
	    method:'post'
	 })
	 var param={menuName:"zlxz"};
	  //alert(Ext.util.JSON.encode(param));  
	 Utils.request(conn,{
	    params:param,
	    scope:this,
	    success:function(data){
	     if(data.access=="true"){
	      flag="true"
			var opentab = Utils.getParameter('opentab');
			if (!opentab) opentab = "toreport";	
			// init tabs
			Issue.Main.tabs.push(new Issue.ToReport());
			Issue.Main.tabs.push(new Issue.Search3());
			Issue.instance = new Ext.TabPanel({
				region: 'center',
				activeTab: Issue.Main.tabIndex[opentab],
				items: Issue.Main.tabs
			});
			
			var mainview = new Ext.Viewport({
		        layout:'border',
		        items:[Issue.instance]
		    });
		   }else{
	      flag="false"
	      alert("noPromise");
	      return;
	     }
	    }
	});
}


Ext.onReady(function(){
	Ext.QuickTips.init();
    Ext.BLANK_IMAGE_URL = '../resources/images/default/s.gif';
	Issue.initUI();
});

